<template>
  <div class="store_container"
  @click="onClick">
    <div class="store_mian_image">
      <img :src="item.mainPic"/>
    </div>
    <div class="store_item_title">
      <div class="store_item_title_wrapper">{{item.title}}</div>
    </div>
    <div class="store_item_desc_container">
      <div class="store_item_desc">{{item.dtitle}}</div>
    </div>
    <div class="store_item_price_container">
      <div class="store_item_price">{{item.actualPrice | priceFilter}}</div>
    </div>
  </div>
</template>

<script>
export default {
  props:{
    item:Object
  },
  filters:{
    priceFilter:function(price){
      return '¥'+' '+price;
    }
  },
  methods:{
    onClick(){
      this.$router.push({
        path:"/details",
        query:{
          id:this.item.id
        }
      })
    }
  }
}
</script>

<style scoped>
.store_container
{
  width: 19%;
  height: 280px;
  margin: 1px 1px;
  background-color: white;
}

.store_mian_image
{
  width: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.store_mian_image img
{
  width: 80%;
}

.store_item_title
{
  width: 100%;
  color: black;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.store_item_title_wrapper
{
  width: 80%;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.store_item_desc_container
{
  width: 100%;
  color: gray;
  font-size: 12px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.store_item_desc
{
  width: 80%;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.store_item_price_container
{
  width: 100%;
  color: red;
  font-size: 16px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
}
</style>